// 定义具体的策略类
import { IStrategy } from "./Interface";

// 这里定义了四个具体的策略类，分别是加法、减法、乘法和除法
export class AddStrategy implements IStrategy {
  execute(a: number, b: number): number {
    return a + b;
  }
}

export class SubStrategy implements IStrategy {
  execute(a: number, b: number): number {
    return a - b;
  }
}

export class MulStrategy implements IStrategy {
  execute(a: number, b: number): number {
    return a * b;
  }
}

export class DivStrategy implements IStrategy {
  execute(a: number, b: number): number {
    return a / b;
  }
}
